cmake_minimum_required(VERSION 3.14)
project(openssh)

set(CMAKE_CXX_STANDARD 14)

include_directories(.)
include_directories(contrib/win32/openssh)
include_directories(contrib/win32/win32compat)
include_directories(contrib/win32/win32compat/inc)
include_directories(contrib/win32/win32compat/inc/arpa)
include_directories(contrib/win32/win32compat/inc/net)
include_directories(contrib/win32/win32compat/inc/netinet)
include_directories(contrib/win32/win32compat/inc/sys)
include_directories(contrib/win32/win32compat/ssh-agent)
include_directories(openbsd-compat)
include_directories(regress/unittests/sshkey)
include_directories(regress/unittests/test_helper)
include_directories(regress/unittests/win32compat)

add_executable(openssh
        contrib/win32/openssh/resource.h
        contrib/win32/win32compat/inc/arpa/inet.h
        contrib/win32/win32compat/inc/arpa/nameser.h
        contrib/win32/win32compat/inc/net/if.h
        contrib/win32/win32compat/inc/netinet/in.h
        contrib/win32/win32compat/inc/netinet/in_systm.h
        contrib/win32/win32compat/inc/netinet/ip.h
        contrib/win32/win32compat/inc/netinet/tcp.h
        contrib/win32/win32compat/inc/sys/ioctl.h
        contrib/win32/win32compat/inc/sys/param.h
        contrib/win32/win32compat/inc/sys/resource.h
        contrib/win32/win32compat/inc/sys/select.h
        contrib/win32/win32compat/inc/sys/socket.h
        contrib/win32/win32compat/inc/sys/stat.h
        contrib/win32/win32compat/inc/sys/statvfs.h
        contrib/win32/win32compat/inc/sys/time.h
        contrib/win32/win32compat/inc/sys/types.h
        contrib/win32/win32compat/inc/sys/uio.h
        contrib/win32/win32compat/inc/sys/un.h
        contrib/win32/win32compat/inc/sys/wait.h
        contrib/win32/win32compat/inc/crypto-wrap.h
        contrib/win32/win32compat/inc/ctype.h
        contrib/win32/win32compat/inc/dirent.h
        contrib/win32/win32compat/inc/dlfcn.h
        contrib/win32/win32compat/inc/fcntl.h
        contrib/win32/win32compat/inc/grp.h
        contrib/win32/win32compat/inc/libgen.h
        contrib/win32/win32compat/inc/netdb.h
        contrib/win32/win32compat/inc/poll.h
        contrib/win32/win32compat/inc/pwd.h
        contrib/win32/win32compat/inc/resolv.h
        contrib/win32/win32compat/inc/signal.h
        contrib/win32/win32compat/inc/spawn.h
        contrib/win32/win32compat/inc/stdio.h
        contrib/win32/win32compat/inc/stdlib.h
        contrib/win32/win32compat/inc/string.h
        contrib/win32/win32compat/inc/strings.h
        contrib/win32/win32compat/inc/syslog.h
        contrib/win32/win32compat/inc/termios.h
        contrib/win32/win32compat/inc/time.h
        contrib/win32/win32compat/inc/unistd.h
        contrib/win32/win32compat/inc/utf.h
        contrib/win32/win32compat/inc/zlib.h
        contrib/win32/win32compat/ssh-agent/agent-main.c
        contrib/win32/win32compat/ssh-agent/agent-request.h
        contrib/win32/win32compat/ssh-agent/agent.c
        contrib/win32/win32compat/ssh-agent/agent.h
        contrib/win32/win32compat/ssh-agent/connection.c
        contrib/win32/win32compat/ssh-agent/keyagent-request.c
        contrib/win32/win32compat/ansiprsr.c
        contrib/win32/win32compat/ansiprsr.h
        contrib/win32/win32compat/console.c
        contrib/win32/win32compat/console.h
        contrib/win32/win32compat/Debug.h
        contrib/win32/win32compat/fileio.c
        contrib/win32/win32compat/lsa_missingdefs.h
        contrib/win32/win32compat/misc.c
        contrib/win32/win32compat/misc_internal.h
        contrib/win32/win32compat/no-ops.c
        contrib/win32/win32compat/openssh-events.h
        contrib/win32/win32compat/pwd.c
        contrib/win32/win32compat/shell-host.c
        contrib/win32/win32compat/signal.c
        contrib/win32/win32compat/signal_internal.h
        contrib/win32/win32compat/signal_sigalrm.c
        contrib/win32/win32compat/signal_sigchld.c
        contrib/win32/win32compat/signal_wait.c
        contrib/win32/win32compat/socketio.c
        contrib/win32/win32compat/spawn-ext.c
        contrib/win32/win32compat/spawn.c
        contrib/win32/win32compat/termio.c
        contrib/win32/win32compat/tncon.c
        contrib/win32/win32compat/tncon.h
        contrib/win32/win32compat/tnnet.c
        contrib/win32/win32compat/tnnet.h
        contrib/win32/win32compat/ttymodes_windows.c
        contrib/win32/win32compat/utf.c
        contrib/win32/win32compat/w32api_proxies.c
        contrib/win32/win32compat/w32api_proxies.h
        contrib/win32/win32compat/w32fd.c
        contrib/win32/win32compat/w32fd.h
        contrib/win32/win32compat/w32log.c
        contrib/win32/win32compat/win32-utf8.c
        contrib/win32/win32compat/win32_dirent.c
        contrib/win32/win32compat/win32_groupaccess.c
        contrib/win32/win32compat/win32_pty.c
        contrib/win32/win32compat/win32_sshpty.c
        contrib/win32/win32compat/win32_sshtty.c
        contrib/win32/win32compat/win32_usertoken_utils.c
        contrib/win32/win32compat/win32_zlib.c
        contrib/win32/win32compat/wmain_common.c
        contrib/win32/win32compat/wmain_sshd.c
        contrib/gnome-ssh-askpass1.c
        contrib/gnome-ssh-askpass2.c
        openbsd-compat/regress/closefromtest.c
        openbsd-compat/regress/opensslvertest.c
        openbsd-compat/regress/snprintftest.c
        openbsd-compat/regress/strduptest.c
        openbsd-compat/regress/strtonumtest.c
        openbsd-compat/arc4random.c
        openbsd-compat/base64.c
        openbsd-compat/base64.h
        openbsd-compat/basename.c
        openbsd-compat/bcrypt_pbkdf.c
        openbsd-compat/bindresvport.c
        openbsd-compat/blf.h
        openbsd-compat/blowfish.c
        openbsd-compat/bsd-asprintf.c
        openbsd-compat/bsd-closefrom.c
        openbsd-compat/bsd-cygwin_util.c
        openbsd-compat/bsd-cygwin_util.h
        openbsd-compat/bsd-err.c
        openbsd-compat/bsd-flock.c
        openbsd-compat/bsd-getline.c
        openbsd-compat/bsd-getpagesize.c
        openbsd-compat/bsd-getpeereid.c
        openbsd-compat/bsd-malloc.c
        openbsd-compat/bsd-misc.c
        openbsd-compat/bsd-misc.h
        openbsd-compat/bsd-nextstep.c
        openbsd-compat/bsd-nextstep.h
        openbsd-compat/bsd-openpty.c
        openbsd-compat/bsd-poll.c
        openbsd-compat/bsd-poll.h
        openbsd-compat/bsd-setres_id.c
        openbsd-compat/bsd-setres_id.h
        openbsd-compat/bsd-signal.c
        openbsd-compat/bsd-signal.h
        openbsd-compat/bsd-snprintf.c
        openbsd-compat/bsd-statvfs.c
        openbsd-compat/bsd-statvfs.h
        openbsd-compat/bsd-waitpid.c
        openbsd-compat/bsd-waitpid.h
        openbsd-compat/chacha_private.h
        openbsd-compat/charclass.h
        openbsd-compat/daemon.c
        openbsd-compat/dirname.c
        openbsd-compat/explicit_bzero.c
        openbsd-compat/fake-rfc2553.c
        openbsd-compat/fake-rfc2553.h
        openbsd-compat/fmt_scaled.c
        openbsd-compat/freezero.c
        openbsd-compat/getcwd.c
        openbsd-compat/getgrouplist.c
        openbsd-compat/getopt.h
        openbsd-compat/getopt_long.c
        openbsd-compat/getrrsetbyname-ldns.c
        openbsd-compat/getrrsetbyname.c
        openbsd-compat/getrrsetbyname.h
        openbsd-compat/glob.c
        openbsd-compat/glob.h
        openbsd-compat/inet_aton.c
        openbsd-compat/inet_ntoa.c
        openbsd-compat/inet_ntop.c
        openbsd-compat/kludge-fd_set.c
        openbsd-compat/libressl-api-compat.c
        openbsd-compat/md5.c
        openbsd-compat/md5.h
        openbsd-compat/mktemp.c
        openbsd-compat/openbsd-compat.h
        openbsd-compat/openssl-compat.c
        openbsd-compat/openssl-compat.h
        openbsd-compat/port-aix.c
        openbsd-compat/port-aix.h
        openbsd-compat/port-irix.c
        openbsd-compat/port-irix.h
        openbsd-compat/port-linux.c
        openbsd-compat/port-linux.h
        openbsd-compat/port-net.c
        openbsd-compat/port-net.h
        openbsd-compat/port-solaris.c
        openbsd-compat/port-solaris.h
        openbsd-compat/port-uw.c
        openbsd-compat/port-uw.h
        openbsd-compat/pwcache.c
        openbsd-compat/readpassphrase.c
        openbsd-compat/readpassphrase.h
        openbsd-compat/reallocarray.c
        openbsd-compat/realpath.c
        openbsd-compat/recallocarray.c
        openbsd-compat/rmd160.c
        openbsd-compat/rmd160.h
        openbsd-compat/rresvport.c
        openbsd-compat/setenv.c
        openbsd-compat/setproctitle.c
        openbsd-compat/sha1.c
        openbsd-compat/sha1.h
        openbsd-compat/sha2.c
        openbsd-compat/sha2.h
        openbsd-compat/sigact.c
        openbsd-compat/sigact.h
        openbsd-compat/strcasestr.c
        openbsd-compat/strlcat.c
        openbsd-compat/strlcpy.c
        openbsd-compat/strmode.c
        openbsd-compat/strndup.c
        openbsd-compat/strnlen.c
        openbsd-compat/strptime.c
        openbsd-compat/strsep.c
        openbsd-compat/strtoll.c
        openbsd-compat/strtonum.c
        openbsd-compat/strtoul.c
        openbsd-compat/strtoull.c
        openbsd-compat/sys-queue.h
        openbsd-compat/sys-tree.h
        openbsd-compat/timingsafe_bcmp.c
        openbsd-compat/vis.c
        openbsd-compat/vis.h
        openbsd-compat/xcrypt.c
        regress/misc/fuzz-harness/authopt_fuzz.cc
        regress/misc/fuzz-harness/pubkey_fuzz.cc
        regress/misc/fuzz-harness/sig_fuzz.cc
        regress/misc/kexfuzz/kexfuzz.c
        regress/unittests/authopt/tests.c
        regress/unittests/bitmap/tests.c
        regress/unittests/conversion/tests.c
        regress/unittests/hostkeys/test_iterate.c
        regress/unittests/hostkeys/tests.c
        regress/unittests/kex/test_kex.c
        regress/unittests/kex/tests.c
        regress/unittests/match/tests.c
        regress/unittests/sshbuf/test_sshbuf.c
        regress/unittests/sshbuf/test_sshbuf_fixed.c
        regress/unittests/sshbuf/test_sshbuf_fuzz.c
        regress/unittests/sshbuf/test_sshbuf_getput_basic.c
        regress/unittests/sshbuf/test_sshbuf_getput_crypto.c
        regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c
        regress/unittests/sshbuf/test_sshbuf_misc.c
        regress/unittests/sshbuf/tests.c
        regress/unittests/sshkey/common.c
        regress/unittests/sshkey/common.h
        regress/unittests/sshkey/test_file.c
        regress/unittests/sshkey/test_fuzz.c
        regress/unittests/sshkey/test_sshkey.c
        regress/unittests/sshkey/tests.c
        regress/unittests/test_helper/fuzz.c
        regress/unittests/test_helper/test_helper.c
        regress/unittests/test_helper/test_helper.h
        regress/unittests/utf8/tests.c
        regress/unittests/win32compat/dir_tests.c
        regress/unittests/win32compat/file_tests.c
        regress/unittests/win32compat/miscellaneous_tests.c
        regress/unittests/win32compat/signal_tests.c
        regress/unittests/win32compat/socket_tests.c
        regress/unittests/win32compat/string_tests.c
        regress/unittests/win32compat/tests.c
        regress/unittests/win32compat/tests.h
        regress/check-perm.c
        regress/mkdtemp.c
        regress/modpipe.c
        regress/netcat.c
        regress/setuid-allowed.c
        addrmatch.c
        atomicio.c
        atomicio.h
        audit-bsm.c
        audit-linux.c
        audit.c
        audit.h
        auth-bsdauth.c
        auth-krb5.c
        auth-options.c
        auth-options.h
        auth-pam.c
        auth-pam.h
        auth-passwd.c
        auth-rhosts.c
        auth-shadow.c
        auth-sia.c
        auth-sia.h
        auth-skey.c
        auth.c
        auth.h
        auth2-chall.c
        auth2-gss.c
        auth2-hostbased.c
        auth2-kbdint.c
        auth2-none.c
        auth2-passwd.c
        auth2-pubkey.c
        auth2.c
        authfd.c
        authfd.h
        authfile.c
        authfile.h
        bitmap.c
        bitmap.h
        canohost.c
        canohost.h
        chacha.c
        chacha.h
        channels.c
        channels.h
        cipher-aes.c
        cipher-aesctr.c
        cipher-aesctr.h
        cipher-chachapoly.c
        cipher-chachapoly.h
        cipher-ctr.c
        cipher.c
        cipher.h
        cleanup.c
        clientloop.c
        clientloop.h
        compat.c
        compat.h
        config.h
        crc32.c
        crc32.h
        crypto_api.h
        defines.h
        dh.c
        dh.h
        digest-libc.c
        digest-openssl.c
        digest.h
        dispatch.c
        dispatch.h
        dns.c
        dns.h
        ed25519.c
        entropy.c
        entropy.h
        fatal.c
        fe25519.c
        fe25519.h
        ge25519.c
        ge25519.h
        groupaccess.c
        groupaccess.h
        gss-genr.c
        gss-serv-krb5.c
        gss-serv.c
        hash.c
        hmac.c
        hmac.h
        hostfile.c
        hostfile.h
        includes.h
        ipcbridge.c
        ipcbridge.h
        kex.c
        kex.h
        kexc25519.c
        kexc25519c.c
        kexc25519s.c
        kexdh.c
        kexdhc.c
        kexdhs.c
        kexecdh.c
        kexecdhc.c
        kexecdhs.c
        kexgex.c
        kexgexc.c
        kexgexs.c
        krl.c
        krl.h
        localsocket.c
        localsocket.h
        log.c
        log.h
        loginrec.c
        loginrec.h
        logintest.c
        mac.c
        mac.h
        match.c
        match.h
        md5crypt.c
        md5crypt.h
        misc.c
        misc.h
        moduli.c
        monitor.c
        monitor.h
        monitor_fdpass.c
        monitor_fdpass.h
        monitor_wrap.c
        monitor_wrap.h
        msg.c
        msg.h
        mux.c
        myproposal.h
        nchan.c
        opacket.c
        opacket.h
        packet.c
        packet.h
        pathnames.h
        pkcs11.h
        platform-misc.c
        platform-pledge.c
        platform-tracing.c
        platform.c
        platform.h
        poly1305.c
        poly1305.h
        progressmeter.c
        progressmeter.h
        readconf.c
        readconf.h
        readpass.c
        rijndael.c
        rijndael.h
        sandbox-capsicum.c
        sandbox-darwin.c
        sandbox-null.c
        sandbox-pledge.c
        sandbox-rlimit.c
        sandbox-seccomp-filter.c
        sandbox-solaris.c
        sandbox-systrace.c
        sc25519.c
        sc25519.h
        scp.c
        servconf.c
        servconf.h
        serverloop.c
        serverloop.h
        session.c
        session.h
        sftp-client.c
        sftp-client.h
        sftp-common.c
        sftp-common.h
        sftp-glob.c
        sftp-server-main.c
        sftp-server.c
        sftp.c
        sftp.h
        smult_curve25519_ref.c
        ssh-add.c
        ssh-agent.c
        ssh-dss.c
        ssh-ecdsa.c
        ssh-ed25519.c
        ssh-gss.h
        ssh-keygen.c
        ssh-keyscan.c
        ssh-keysign.c
        ssh-pkcs11-client.c
        ssh-pkcs11-helper.c
        ssh-pkcs11.c
        ssh-pkcs11.h
        ssh-rsa.c
        ssh-sandbox.h
        ssh-xmss.c
        ssh.c
        ssh.h
        ssh2.h
        ssh_api.c
        ssh_api.h
        sshbuf-getput-basic.c
        sshbuf-getput-crypto.c
        sshbuf-misc.c
        sshbuf.c
        sshbuf.h
        sshconnect.c
        sshconnect.h
        sshconnect2.c
        sshd.c
        ssherr.c
        ssherr.h
        sshfileperm.h
        sshkey-xmss.c
        sshkey-xmss.h
        sshkey.c
        sshkey.h
        sshlogin.c
        sshlogin.h
        sshpty.c
        sshpty.h
        sshtty.c
        ttymodes.c
        ttymodes.h
        uidswap.c
        uidswap.h
        umac.c
        umac.h
        umac128.c
        utf8.c
        utf8.h
        uuencode.c
        uuencode.h
        verify.c
        version.h
        xmalloc.c
        xmalloc.h
        xmss_commons.c
        xmss_commons.h
        xmss_fast.c
        xmss_fast.h
        xmss_hash.c
        xmss_hash.h
        xmss_hash_address.c
        xmss_hash_address.h
        xmss_wots.c
        xmss_wots.h)
